.TH std::basic_osyncstream::get_wrapped 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::basic_osyncstream::get_wrapped \- std::basic_osyncstream::get_wrapped

.SH Synopsis
   streambuf_type* get_wrapped() const noexcept;

   Returns a pointer to the wrapped std::basic_streambuf, obtained by calling
   get_wrapped() on the underlying std::basic_syncbuf.

.SH Parameters

   \fI(none)\fP

.SH Example

   Wrapped buffer can be safely wrapped again in a different synchronized output
   stream.


// Run this code

 #include <iostream>
 #include <syncstream>

 int main()
 {
     std::osyncstream bout1(std::cout);
     bout1 << "Hello, ";
     {
         std::osyncstream(bout1.get_wrapped()) << "Goodbye, " << "Planet!" << '\\n';
     } // emits the contents of the temporary buffer
     bout1 << "World!" << '\\n';
 } // emits the contents of bout1

.SH Output:

 Goodbye, Planet!
 Hello, World!

.SH See also

   destructor   destroys the basic_osyncstream and emits its internal buffer
                \fI(public member function)\fP
                retrieves the wrapped streambuf pointer
   get_wrapped  \fI(public member function of std::basic_syncbuf<CharT,Traits,Allocator>)\fP

